import request from '@/utils/request'

export function getInfo(query) {
  return request({
    url: '/mes/equip/query',
    method: 'get',
    params: query
  })
}
export function add(data) {
  return request({
    url: '/mes/equip/add',
    method: 'put',
    data
  })
}
export function del(id) {
  return request({
    url: `/mes/equip/delete/${id}`,
    method: 'delete'

  })
}
export function maintenance(data) {
  return request({
    url: `/mes/maintenance/query/`,
    method: 'get',
    params: data
  })
}
export function qrCodeNew(data) {
  return request({
    url: `/denCode/qrCodeType`,
    method: 'get',
    params: data,
    responseType: 'arraybuffer'
  })
}
export function uploadFile(id, data) {
  return request({
    url: `/mes/equip/uploadFile/${id}`,
    method: 'post',
    data
  })
}
export function getfile(id) {
  return request({
    url: `/mes/equip/file/${id}`,
    method: 'get'

  })
}
export function download(id) {
  return request({
    url: `/mes/equip/downloadFile/${id}`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
export function delfile(id) {
  return request({
    url: `/mes/equip/uploadFile/cancel/${id}`,
    method: 'delete'

  })
}
